#ifndef __DBDETECT_H__
#define __DBDETECT_H__

#include <memory>
namespace secsmart_session
{
    typedef struct session session_t;
    typedef std::shared_ptr<session_t> session_sptr;
}

namespace secsmart_tcpip
{
    typedef struct tcp_stream_data tcp_stream_data_t;
}

namespace dbdetect
{

    typedef enum
    {
        PROTOCOL_UNKNOWN = 0,
        PROTOCOL_MYSQL,
        PROTOCOL_MARIADB,
        PROTOCOL_GBASE8A,
        PROTOCOL_TIDB
    } proto_type_t;

    enum PHASE_TYPE { PHASE_FULL_LINK = 0, PHASE_HALF_LINK };

    enum RESUTL_TYPE { RET_UNKNOWN = -1, RET_S2C = 0, RET_C2S, RET_UNSURE, RET_OVER };

    class MySQLProtocol;

    std::shared_ptr<MySQLProtocol> initParser(std::string& targetFileName, int32_t maxth, bool checkCompress=false);

    void parseData(secsmart_session::session_sptr pSession, std::shared_ptr<MySQLProtocol> parserPTR, const secsmart_tcpip::tcp_stream_data_t *data);

}
#endif